package com.google.coffeeshop.gui.desktop.receiptnote;

import java.awt.FlowLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;

import org.hibernate.annotations.Parent;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ReceiptNoteActionsPanel extends JPanel {
	
	private ReceiptNotePanel receiptNotePanel;
	
	public ReceiptNoteActionsPanel(final ReceiptNotePanel panel) {
		receiptNotePanel = panel;
		setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
		
		JToolBar toolBar = new JToolBar();
		
		JButton btnAdd = new JButton("Add");
		btnAdd.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				AddViewReceiptNoteFrame frmAddViewReceiptNote = new AddViewReceiptNoteFrame(receiptNotePanel, null);
				frmAddViewReceiptNote.setVisible(Boolean.TRUE);
			}
		});
		btnAdd.setVerticalTextPosition(SwingConstants.BOTTOM);
		btnAdd.setHorizontalTextPosition(SwingConstants.CENTER);
		btnAdd.setIcon(new ImageIcon(ReceiptNoteActionsPanel.class.getResource("/com/google/coffeeshop/gui/desktop/icon/size24/add-24.png")));
		toolBar.add(btnAdd);
		
		JButton btnView = new JButton("View");
		btnView.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				receiptNotePanel.showAddEditEmployeeFrame();
			}
		});
		btnView.setVerticalTextPosition(SwingConstants.BOTTOM);
		btnView.setHorizontalTextPosition(SwingConstants.CENTER);
		btnView.setIcon(new ImageIcon(ReceiptNoteActionsPanel.class.getResource("/com/google/coffeeshop/gui/desktop/icon/size24/view-24.png")));
		toolBar.add(btnView);
		
		add(toolBar);
	}

	
	
	private static final long serialVersionUID = 1L;

}
